<div class="col-md-10 col-md-offset-1">
<?PHP
/* display message saved in session if any */
echo $this->Session->flash();

foreach ($this->Session->read('usermessages') as $message){ ?>
	<div class="col-md-12 img-thumbnail">
		<h1><span class="glyphicon glyphicon-envelope"></span> Nachricht <?PHP echo $message['Message']['id'] ?></h1>
		<hr />
		<div class="form-group">
			<span class="label label-default col-md-12">Absender</span>
			<span class="col-xs-offset-1">
			<?PHP echo $message['Message']['fromUser']; ?>
			</span>
		</div>
		<div class="form-group">
			<span class="label label-default col-md-12">Betreff</span>
			<span class="col-xs-offset-1">
			<?PHP echo $message['Message']['subject']; ?>
			</span>
		</div>
		<?PHP
			if($message['Message']['readed']){
		?>
			<span class="label label-info col-md-12">Gelesen</span>
		<?PHP
			}else{
		?>	
			<span class="label label-info col-md-12">Ungelesen</span>
		<?PHP
		}
		?>
		<hr />
		<ul class="nav nav-pills">
			<?PHP
				/* link Mitglieder */
				echo $this->Html->tag('li', $this->Html->link('Details', array('controller' => 'messages', 'action' => 'detail', $message['Message']['id']) , null));
			?>
		</ul>
	</div>
<?PHP
}
?>
</div>